package com.huike.web.controller.business;

import com.huike.business.domain.TbBusinessClueTrackRecord;
import com.huike.business.domain.vo.TbBusinessTrackRecordVo;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.clues.service.ITbClueTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.controller.BaseController;

import java.util.Date;
import java.util.List;

/**
 * 商机跟进记录Controller
 * @date 2021-04-28
 */
@RestController
@RequestMapping("/business/record")
public class TbBusinessTrackRecordController extends BaseController {
@Autowired
private ITbBusinessTrackRecordService iTbBusinessTrackRecordService;
@GetMapping("list")
    public AjaxResult getTbByBusinessId(Integer businessId){
    List<TbBusinessTrackRecordVo> tbBusinessTrackRecordVos = iTbBusinessTrackRecordService.selectTbBusinessTrackBybuId(businessId);
        return AjaxResult.success(tbBusinessTrackRecordVos);


}
@PostMapping
    public void addTbBusinness(@RequestBody TbBusinessClueTrackRecord tbBusinessClueTrackRecord){
    tbBusinessClueTrackRecord.setCreateBy("wy");
    tbBusinessClueTrackRecord.setCreateTime(new Date());
    int i = iTbBusinessTrackRecordService.addTbBusinness(tbBusinessClueTrackRecord);
    int i2 = iTbBusinessTrackRecordService.updateTbBusinessWy(tbBusinessClueTrackRecord);
    System.out.println("add:"+i);
    System.out.println("update:"+i2);
}
}
